//
//  DLView.m
//  FRP_OC
//
//  Created by DeLongYang on 2017/11/2.
//  Copyright © 2017年 DeLongYang. All rights reserved.
//

#import "DLView.h"

@implementation DLView

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self dl_setupViews];
        [self dl_bindViewModel];
    }
    return  self;
}

#pragma mark ---- DLViewProtocol
- (instancetype) initWithViewModel:(id<DLViewModelProtocol>)viewModel
{
    self = [super init];
    if (self) {
        [self dl_setupViews];
        [self dl_bindViewModel];
    }
    return self;
}


- (void)dl_setupViews
{
    
}

- (void)dl_bindViewModel
{
    
}


/**
 无论点击啥地方 收起键盘
 */
- (void)dl_addReturnKeyBoard
{
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] init];
    tap.numberOfTouchesRequired = 1;
    tap.numberOfTapsRequired = 1;
    [tap.rac_gestureSignal subscribeNext:^(__kindof UIGestureRecognizer * _Nullable x) {
        AppDelegate *appDelegate  = (AppDelegate *)[UIApplication sharedApplication].delegate;
        [appDelegate.window endEditing:YES];
    }];
    [self addGestureRecognizer:tap];
}













@end
